package demo2;

/**
 * 方法一：通过构造方法
 * 方法二：通过set方法
 * @description: 使用spring注入属性
 * @author: apple
 * @date:  2022/2/1 11:13 下午
 * @version 1.0
 **/
public class Book {

    private String bookName;

    private String author;

    public Book(String b, String a) {
        this.bookName = b;
        this.author = a;
    }

    public Book() {
    }

    public String getAuthor() {
        return author;
    }

    public void setAuthor(String author) {
        this.author = author;
    }

    public Book(String bookName) {
        this.bookName = bookName;
    }

    public String getBookName() {
        return bookName;
    }

    public void setBookName(String bookName) {
        this.bookName = bookName;
    }

    @Override
    public String toString() {
        return "Book{" +
                "bookName='" + bookName + '\'' +
                ", author='" + author + '\'' +
                '}';
    }
}
